package com.example.drink_order_system.activity;

import android.graphics.Bitmap;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;

import androidx.appcompat.app.AppCompatActivity;

import com.bumptech.glide.Glide;
import com.example.drink_order_system.R;
import com.example.drink_order_system.tool.ImageUtil;
import com.example.drink_order_system.tool.ZoomImageView;

public class PhotoPreview extends AppCompatActivity {
    private LinearLayout photo_preview_layout;
    private ZoomImageView photo_preview;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_photo_preview);
        photo_preview = findViewById(R.id.photo_preview);
        String imgtmp = getIntent().getStringExtra("preview");
        Bitmap bitmap = ImageUtil.base64ToImage(imgtmp);
        Glide.with(this).load(bitmap).centerCrop().into(photo_preview);
        findViewById(R.id.photo_preview_layout).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }
}